/*
 * Created on 2006-2-10
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.hitrust.gs.action;

import java.util.ArrayList;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.service.GSBaseManager;
import com.hitrust.gs.bean.GSDictionaryBean;
import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.business.*;
import com.hitrust.gs.dao.GSDictionaryDAO;
/**
 * @author simonyi
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class GSBusOrderInputAction extends GSBaseAction {

    public String execute(GSBaseForm aForm) throws Exception {
        
        GSOperatorBean operatorBean = (GSOperatorBean)aForm.getSession().getAttribute(GSBaseConstants.LOGIN);
        
        GSBusOrgProcessor processer = new GSBusOrgProcessor ();
        //if(aForm.getSession().getAttribute("organdaddr") == null){
            ArrayList ary = processer.getSubOrgAndInfo(operatorBean.getGs_oper_org_id());
            aForm.getRequest().setAttribute("organdaddr",ary);
        //}

        ArrayList bcList = GSBaseManager.getAllBalanceCategory();
        aForm.getRequest().setAttribute("balancecategory",bcList);
        
        //配送方式
        GSDictionaryDAO dictionary = new GSDictionaryDAO();
        ArrayList delivermodeList = dictionary.queryByParentId(GSDictionaryBean.DeliverMode);
        aForm.getRequest().setAttribute("deliverModeList", delivermodeList);
        
        //结算方式
        ArrayList balanceModeList = dictionary.queryByParentId(GSDictionaryBean.BalanceMode);
        aForm.getRequest().setAttribute("balanceModeList", balanceModeList);
        
        return GSBaseConstants.FORWARD_SUCCESS;
    }
}
